package com.zhny.iot.syb.weather.plugin;


import com.zhny.aiot.plugin.ICenterFacilities;
import com.zhny.aiot.plugin.IDevice;
import com.zhny.aiot.plugin.model.DeviceEntity;
import com.zhny.aiot.plugin.model.FactoryType;
import com.zhny.aiot.plugin.model.StoreEntity;
import com.zhny.aiot.plugin.web.WebDeviceFactory;
import com.zhny.iot.syb.weather.plugin.model.WeatherStoreEntry;
import org.pf4j.Extension;
import org.pf4j.Plugin;
import org.pf4j.PluginWrapper;

public class WeatherPlugin extends Plugin {
    public WeatherPlugin(PluginWrapper wrapper) {
        super (wrapper);
    }
    @Extension
    public static class WeatherFactory extends WebDeviceFactory {

        @Override
        public Class configClass() {
            return WeatherConfig.class;
        }

        public IDevice createDevice(ICenterFacilities iCenterFacilities, DeviceEntity entity) {
            return new WeatherDevice(this, iCenterFacilities, entity);
        }

        public Class<? extends StoreEntity> storeClass() {
            return WeatherStoreEntry.class;
        }

        public String getId() {
            return "syb-weather-plugin";
        }

        public String getName() {
            return "事业部一体化气象站";
        }

        public FactoryType getType() {
            return FactoryType.WeatherStation;
        }
    }
}
